<template>
<div class="home-container">
<!-- 头部区域 -->
<MyHeader v-if="!isGuanyuPath"></MyHeader>
<MyHeader1 v-else></MyHeader1>
<!-- 主体区域 -->
<div class="home-main-box"> 
<!-- 左侧边栏区域 -->
<MyAside></MyAside>
<!-- 右侧内容主体区域 -->
<div class="home-main-body">
<!-- 路由的视图 -->
<router-view></router-view>

</div>
</div> 
</div>
</template>
<script setup>
// 头部组件
import MyHeader from './subcomponents/MyHeader.vue'
import MyHeader1 from './subcomponents/GeReng/sub/MyHeader1.vue';
// 左侧边导航组件
import ShouYe from './subcomponents/ShouYe.vue';
import { computed } from 'vue';
import { useRoute } from 'vue-router';

// 使用 vue-router 的 useRoute 获取当前路由
const route = useRoute();

// 计算属性判断当前路径是否为 '/home/guanyu'
const isGuanyuPath = computed(() => {return route.path.startsWith('/home/guanyu');});
</script>

<style lang="less">
.home-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  .home-main-box {
    height: 100%;
    display: flex;
    .home-main-body {
      padding: 15px;
      flex: 1;
    }
  }
}
</style>